Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support packages that use modules #1556

Merged

Conversation

void-mAlex
Copy link
Collaborator

.mjs files can be imported directly by an app
we should allow babel to handle any features the library is using to match the targets set in the app

babel is more than capable of transpiling .mjs files as it's an unambiguous extension that could use features the user is not targeting like private fields or the next hottest ecma script proposal.

this change optionally matches those files as well for processing by babel when stage3 asks about it.

we should allow babel to handle any features the library is using to match the targets set in the app
@ef4
Copy link
Contributor

ef4 commented Jul 24, 2023

I think this a fine incremental improvement and we can merge it.

But in the medium term, I expect this to be wrong because depending on the specifics of your build system, babel may see all kinds of different extensions. But also, this code only exists to power the skipBabel option, which is only needed when users don't control their own babel config, which I expect to stop being a thing.

@void-mAlex
Copy link
Collaborator Author

it's fine, more than happy to make this change in my own webpack/babel config one in able to but right now can't due to this being hardcoded
if my understanding of what your saying is correct I would be able to handle this config once it's a stand-alone file

this came up for me while trying to get embroider working for an app with a requiement for ie 11 as a target and not having any success with passing webpack config for targets : ['web','es5']
this change worked to handle a module only package that is a dependency of the app
would love to get this as an incremental improvement

@ef4 ef4 merged commit 9048919 into embroider-build:main Jul 25, 2023
196 checks passed
@mansona mansona added the enhancement New feature or request label Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants